<?php

class LoginPage extends CI_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->helper('url_helper');
        $this->load->model('OceanBlog/Ob_login');
    }

    public function index() {
        $this->load->view('OceanBlog/login');
    }

    public function checkLogin() {
        $result =  $this->Ob_login->checkLogin($this->input->post('username'), $this->input->post('password'));
        if ($result){
            $this->output->set_status_header(200);
        }else{
            $this->output->set_status_header(400, 'Username or password invalid' );
        }
    }

}
